<!DOCTYPE html>
<html>
<head>
	<title>{$name}┊{$site_name}</title>
    <meta http-equiv="Content-Language" content="en-US">
	<meta name="keywords" content="{$seo_keywords}" />
	<meta name="description" content="{$seo_description}">
    <tc_include file="Public:head" />
                  <script type="text/javascript" language="javascript">  
        function nofind(){
        var img=event.srcElement;
        img.src="__TMPL__Public/images/no-img.jpg";
        img.onerror=null; 
        }
        </script>
</head>
 <php>
$first = sp_get_terms($cat_id);
$t1 = $t2 = $t3 = 0;
for($i = 0;$i < sizeof($first);$i++)
{
    if($cat_id == $first[$i][parent])
    {
    	 $t1 = $t2 = $first[$i][term_id];
         $t3 = $t2.','.$t3;
    }
}
</php>
</head>
<body>
<tc_include file="Public:nav" />
<div class="container">
	
	
    <div class="pg-opt pin">
        <div class="col-md-12">
                    <div style=" float:right;">
                        <ol style="margin-top: 34px;">
                        <a href="__ROOT__/" style="color: #59b2e5;">Главная</a> ┊
                        {$name}
                        </ol>
        			</div>
                        <h2>{$name}</h2>
                    <h5 style="margin-left:50px;white-space: nowrap;">
                            <php>
                                $first = sp_get_terms($cat_id);
                                for($i = 0;$i < sizeof($first);$i++)
                                {
                                    if($cat_id == $first[$i][parent])
                                    {
                                    </php>
                                         <a href="{:u('list/index',array('id'=>$first[$i][term_id]))}" style="color: #59b2e5;">{$first[$i][name]}</a>┊
                                    <php>
                                    }
                                }
                        </php>
                    </h5>
                </div>
    </div>

    <div class="container">
        <div>
             <php>
             		$lists = sp_sql_posts_paged("cid:$t3;order:post_date DESC;",20);
             	</php>
             <div id="container">
             	<div class="grid-sizer"></div>
             	<volist name="lists['posts']" id="vo">
             	<php>
             		$smeta=json_decode($vo['smeta'], true);
             	</php>
             	 
                <div class="item">
					<div class="tc-gridbox">
                        <div class="header">
                            
                      	<if condition="!empty($smeta['thumb'])">
						<div class="item-image">
                      		<a href="{:leuu('article/index',array('id'=>$vo['tid']))}">
								<img  src="{:sp_get_asset_upload_path($smeta['thumb'])}" class="img-responsive" alt="{$vo.post_title}">
							</a>
						</div>
                      	<else/>
                      	</if>
                     
                            <h3><a href="{:leuu('article/index',array('id'=>$vo['tid']))}">{$vo.post_title}</a></h3>
                            <hr>
                        </div>
                        <div class="body">
                        	<a href="{:leuu('article/index',array('id'=>$vo['tid']))}">{$vo.post_excerpt}</a>
                        </div>
                        <div class="footer">
                        	<div class="pull-left"><span class="meta">{$vo.post_date}</span></div>
                        	<div class="pull-right">
	                        	<a href="javascript:;"><i class="fa fa-eye"></i><span>{$vo.post_hits}</span></a>
								<a href="{:U('article/do_like',array('id'=>$vo['object_id']))}" class="J_count_btn"><i class="fa fa-thumbs-up"></i><span class="count">{$vo.post_like}</span></a>
								<a href="{:U('user/favorite/do_favorite',array('id'=>$vo['object_id']))}" class="J_favorite_btn" data-title="{$vo.post_title}" data-url="{:U('portal/article/index',array('id'=>$vo['tid']))}" data-key="{:sp_get_favorite_key('posts',$vo['object_id'])}">
									<i class="fa fa-star-o"></i>
								</a>
							</div>
							<div class="clearfix"></div>
						</div>
					</div>
                </div>
                 </volist>
               </div>
             <div class="pagination">
              <ul>
                  {$lists['page']}
              </ul>
             </div>
        </div>
    </div>
    
    
    <tc_include file="Public:footer" />
</div>

    
<!-- JavaScript -->
<tc_include file="Public:scripts" />
 <script src="__TMPL__Public/js/imagesloaded.pkgd.min.js"></script>
    <script src="__TMPL__Public/js/masonry.pkgd.min.js"></script>
	<script>
	var $container=$('#container').masonry({
		  columnWidth: '.grid-sizer',
		  itemSelector: '.item'
		});
	// layout Masonry again after all images have loaded
	$container.imagesLoaded( function() {
	  $container.masonry();
	});
	
	</script>
</body>
</html>